<#assign pageName="系统菜单管理">
<@override name="page-content">
    <form class="layui-form form-horizontal" role="form" method="post">
        <div class="layui-form-search panel">
            <input type="text" hidden="hidden" name="_STATE"/>
            <@ctrl.TreeSelectQuery path="menus.guid" dataList=guidsList![] fieldText="sysModuleName"  class=""
                fieldValue="guid" labelText="所属平台" fieldParentID="upperGuid" parentidValue="${(guids.upperGuid)!'-1'}" />
            <div class="margin-5">
                <a href="javascript:;" onclick="$('form:first').submit();" class="layui-btn layui-btn-sm">
                    <i class="layui-icon layui-icon-search"></i>查询
                </a>
                <a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-sm js-add">
                    <i class="layui-icon layui-icon-add-1"></i>新增
                </a>
            </div>
        </div>
        <table class="layui-table">
            <thead>
                <tr>
                    <th class="align-center" width="50px" nowrap="nowrap">序号</th>
                    <th class="align-center layui-hide-xs" nowrap="nowrap">排序号</th>
                    <th class="align-center" nowrap="nowrap">菜单类型</th>
                    <th class="align-center" nowrap="nowrap">菜单名称</th>
                    <th class="layui-hide-xs">链接地址</th>
                    <th class="align-center" width="120px">操作</th>
                </tr>
            </thead>

            <tbody>
                <#if menuList?has_content>
                <@ctrl.Recursive dataList=menuList![] fieldID='menuId' fieldParentID='upperId' parentidValue='-1';dataItem,level,separator,dataIndex>
                <tr>
                    <td class="align-center" width="50px" nowrap="nowrap">
                        ${dataIndex}
                    </td>
                    <td class="align-center layui-hide-xs" nowrap="nowrap">
                        ${dataItem.orderNo}
                    </td>
                    <td class="align-center" nowrap="nowrap">
                        <#if dataItem.type == "0">权限菜单
                        <#elseif dataItem.type == "1">默认菜单
                        </#if>    
                    </td>
                    <td nowrap="nowrap">
                        <span style="${caption_class}">
                            <#if level gt 0><#list 1..level as i>${separator}</#list></#if>
                            <i class="ace-icon ${dataItem.icon} "></i>
                            ${dataItem.menuCaption}
                        </span>
                    </td>
                    <td class="layui-hide-xs">
                        <a href="${contextPath}${dataItem.httpAddress}" target="_blank" >${dataItem.httpAddress}</a>
                    </td>
                    <td class="align-center">
                        <div class="layui-table-cell">
                             <a class="layui-btn layui-btn-normal layui-btn-xs" href="edit/${dataItem.menuId}">
                                <i class="layui-icon layui-icon-edit"></i>编辑
                             </a> 
                             <button type="button" class="layui-btn layui-btn-danger layui-btn-xs"
                                onclick="confirmSubmit('确定删除菜单‘${dataItem.menuCaption}’数据？', {menuId:'${dataItem.menuId}'}, 'del')">
                                <i class="layui-icon layui-icon-delete"></i>删除
                             </button>
                        </div>
                    </td>
                </tr>
                </@ctrl.Recursive>
                <#else>
                    <tr>
                        <td colspan="6" style="color:red;text-align:center;font-weight:bold;">暂无符合条件的菜单数据信息</td>
                    </tr>
                </#if>
            </tbody>
        </table>
    </form>
</@override>
<@override name="page-scripts">
    <script>
        $(function(){
            layui.use(['form','layer', 'jquery'], function(){
                var form=layui.form;
                var layer=layui.layer;
                var $ = layui.jquery;
                $('.js-add').on('click', function(){
                    var guid = $('#guid').val();
                    window.location.href="${contextPath}/admin/menus/add/"+guid;
                });
            })
        })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 